function checkLogin() {
    var fm = document.login;
    if(fm.user.value == '') {
    	alert('用户名不能为空!');
    	fm.user.focus();
    	return false;
    }
    if(fm.pass.value == '') {
    	alert('密码不能为空!');
    	fm.pass.focus();
    	return false;
    }
    if(fm.code.value == '') {
    	alert('用户名不能为空!');
    	fm.code.focus();
    	return false;
    }
    return true;
}
function releaseSub() {
	var fm = document.login;
    var sub = fm.send;
    sub.disabled = false;
}
function ajaxCheckCode() {
	var fm = document.login;
	var code = fm.code;
	var sub = fm.send;
	var warning = document.getElementById('warning');
	warning.style.display = 'none';
	ajax({
        'method':'post',
        'async':false,
        'url':'?a=admin&m=ajaxCheckCode',
        'data': {
            'code':code.value
        },
        success : function(text) {
            if(text == 1) {             
                warning.style.display = 'block';
                sub.disabled = true;
            }
        }   
    });
}